package com.star.spring.dubbo.consumer.controller;

import org.apache.dubbo.config.annotation.DubboReference;

import com.star.spring.dubbo.api.GreetingService;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class DemoController {

    @DubboReference(check = false, injvm = false, loadbalance = "roundrobin")
    private GreetingService greetingService;

    @GetMapping("/dubbo/hello")
    public String hello(@RequestParam(defaultValue = "World") String name) {
        return greetingService.sayHello(name);
    }

}


